package com.zzyl.common.utils;


public class UserThreadLocal {
    //定义了一个内存容器,以便提取或储存
    private static final ThreadLocal<Long> CONTEXT = new ThreadLocal<>();
    /**
     * 存入内存
     */
    public static void set(Long id){
        CONTEXT.set(id);
    }
    /**
     * 取出id
     */
    public static Long get(){
        return CONTEXT.get();
    }
    /**
     * 清理内存
     */
    public static void clear(){
         CONTEXT.remove();
    }

}
